<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.saturn.auth.User"%>
<%@page import="com.saturn.app.utils.DateUtils"%>
<%@page import="com.saturn.auth.Organization"%>
<%@page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
	User user = (User)session.getAttribute("authUser");
	String userId = user.getId();
	Organization organizationUser = Organization.getOneOrganizationByUser(userId);
	String name = organizationUser.getName();
	List organizations = Organization.getOrganizationByUser(user.getId());
	String department = "";
	if (organizations != null && !organizations.isEmpty()) {
		department = ((Organization)organizations.get(0)).getName();
	}
	%>	
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加对账信息</title>
<%@ include file="/app/includes/header.jsp"%>
<script type="text/javascript">
	function add() {
		$('#addForm').submit();
	}
	

	$(function() {
		//部门
		$('#department').combobox({
			width:256
		});
		//付款科目
		$('#subject').combobox({
			width:256
		});
	});
</script>
</head>
<body>
	<div id="panel" class="easyui-panel" title="添加对账信息" icon="icon-add-form"
		collapsible="true" style="padding: 10px;">
		<form id="addForm" name="addForm" action="<%=request.getContextPath()%>/app/sldb/reconciliation/tmp/addReconciliation.action" method="post">
			<input id="createTime" name="createTime" type="hidden" value="<%=DateUtils.getSystemTime()%>"></input>
			<input id="creater" name="creater" type="hidden" value="<%=user.getId()%>"></input>
			<input id="createrName" name="createrName" type="hidden" value="<%=user.getName()%>"></input>
			<input id="state" name="state" type="hidden" value="正常"></input>
			<input id="surplus" name="surplus" type="hidden" value="0"></input>
			<input id="type" name="type" type="hidden" value="一事一议"></input>
			<table class="table-form">
				<tr>
					<td style="text-align:right">部门:</td>
					<td><select id="department" class="easyui-combobox"
								name="department" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.address" valueField="id"
								textField="text" editable="false"></select></td>
					<td><div id="numberTip"></div></td>
				</tr>
				<tr>
					<td style="text-align:right">科目:</td>
					<td><select id="subject" class="easyui-combobox"
								name="subject" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.subject" valueField="id"
								textField="text" editable="false"></select></td>
					<td><div id="idTip"></div></td>
				</tr>
				<tr>
					<td style="text-align:right">金额（元）:</td>
					<td><input id="total" name="total" type="text"></input></td>
					<td><div id="totalTip"></div></td>
				</tr>
				<tr>
					<td style="text-align:right">备注:</td>
					<td><input id="remark" name="remark" type="text"></input>
					</td>
					<td><div id="passwordTip"></div></td>
				</tr>
				<tr>
					<td colspan="3">
						<div style="padding: 10px;">
							<a href="#" onclick="add()" class="easyui-linkbutton"
								iconCls="icon-add">添加</a> <a href="javascript:history.back(-1)"
								class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
						</div></td>
				</tr>
			</table>
		</form>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		$.formValidator.initConfig({
			formid : "addForm"
		});
		$("#name").formValidator({
			onfocus : "用户姓名不能为空,不超过10个字符！"
		}).inputValidator({
			min : 1,
			max : 10
		});

	});
</script>
</html>